<template>
  <div class="testRecord">
    <div class="searchDiv">
      <Tabs type="card" @on-click="tabclick" value="tb1">
        <TabPane name="tb1" label="月度试验记录（MTU）">
        </TabPane>
        <TabPane name="tb2" label="月度试验记录（UD45）">
        </TabPane>
         <TabPane name="tb3" label="再鉴定试验记录（LHS热备用）">
        </TabPane>
        <TabPane name="tb4" label="再鉴定试验记录（LHS运行）">
        </TabPane>
         <TabPane name="tb5" label="再鉴定试验记录（MTU）">
        </TabPane>
        <TabPane name="tb6" label="再鉴定试验记录（UD45）">
        </TabPane>
     </Tabs>
      <Form :model="searchItem" :label-width="90">
        <Row :gutter="10">
          <Col span="6">
            <FormItem label="电站">
              <Select v-model="searchItem.powerStation" clearable filterable @on-change="getHd">
                <Option
                  v-for="(item, index) in powerStationList"
                  :value="item"
                  :key="index"
                >{{ item }}</Option>
              </Select>
            </FormItem>
          </Col>
          <Col span="6">
            <FormItem label="HD编号">
              <Select
                v-model="searchItem.hdNumber"
                clearable
                filterable
                :disabled="HBnumberList.length == 0"
                @on-change="getJz"
              >
                <Option v-for="(item, index) in HBnumberList" :value="item" :key="index">{{ item }}</Option>
              </Select>
            </FormItem>
          </Col>
          <Col span="6">
            <FormItem label="机组编号">
              <Select
                v-model="searchItem.aircrewNumber"
                clearable
                filterable
                :disabled="JZnumberList.length == 0"
              >
                <Option v-for="(item, index) in JZnumberList" :value="item" :key="index">{{ item }}</Option>
              </Select>
            </FormItem>
          </Col>
          <Col span="6">
            <FormItem label="参数名称">
              <Select filterable v-model="searchItem.type">
                <Option v-for="(item, index) in canshu" :value="item.type" :key="index">{{ item.name }}</Option>
              </Select>
            </FormItem>
          </Col>
          <!-- <Col span="6">
                    <FormItem label="参数组">
                      <Input v-model="searchItem.groupName" placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
           <Col span="6">
                    <FormItem label="参数名称">
                      <Input v-model="searchItem.name" placeholder="请输入"></Input>
                    </FormItem>
                  </Col> -->
           <Col span="6">
            <FormItem label="时间">
              <DatePicker type="datetimerange" @on-change="changeTime" format="yyyy-MM-dd HH:mm:ss"	:value="timearry" :options="options2" placement="bottom-end" placeholder="请选择时间范围" style="width:100%"></DatePicker>
            </FormItem>
          </Col>
          <!-- <Col span="6">
            <FormItem label="试验日期">
              <DatePicker
                type="datetime"
                v-model="searchItem.experimentDate"
                @on-change="time1"
                 format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择日期"
                style="width: 100%"
              ></DatePicker>
            </FormItem>
          </Col>
          <Col span="6">
            <FormItem label="试验代码">
              <Input v-model="searchItem.experimentCode" placeholder="请输入"></Input>
            </FormItem>
          </Col>
          <Col span="6">
            <FormItem label="记录人">
               <Select v-model="searchItem.recordName" clearable filterable>
                          <Option v-for="(item, index) in peopleList" :value="item.trueName" :key="index">{{item.trueName}}</Option>
                      </Select>
            </FormItem>
          </Col>
          <Col span="6">
            <FormItem label="记录时间">
              <DatePicker
                type="datetime"
                v-model="searchItem.recordTime"
                placeholder="记录时间"
                @on-change="time2"
                 format="yyyy-MM-dd HH:mm:ss"
                style="width: 100%"
              ></DatePicker>
            </FormItem>
          </Col> -->
          <Col span="12">
            <Button type="primary" class="marRight" @click="addJz">加入对比</Button>
            <Button type="success" class="marRight" @click="formItem={};qxList=[];csList=[];add()">新增记录</Button>

            <Upload style="display:inline-block"
                ref="upload"
                  :show-upload-list="false"
                  :headers='fileheader'
                  :on-success='fileSuccess'
                  :action="apihost+'/admin-api/admins/monthlyTestRecordMtu/upload'">
                  <Button type="info" class="marRight">导入Excel</Button>
              </Upload>
            <Button type="primary" @click="down">导出Excel</Button>
          </Col>
        </Row>
        <div v-if="tagList1.length > 0" style="margin-bottom:10px;">
          <Tag
            type="border"
            color="primary"
            v-for="item in tagList1"
            :key="item"
            :name="item"
            closable
            @on-close="handleClose1"
            >{{ item }}</Tag
          >
        </div>
      </Form>
    </div>

     <div
      id="myChart"
      style="width:100%;height:500px;border-top:1px solid #ccc;padding-top:10px;"
    ></div>
    <Table style="margin-top:10px;" border :columns="columns" :data="tableData" :loading="loading"></Table>
    <Page show-total :total="total" :current="pageNo" :page-size="pageSize" @on-change="changePage"  style="margin:20px auto;text-align:center"/>
    <!-- 新增弹窗开始 -->
    <Modal :mask-closable="false" v-model="modal1" :title="title1" width="1000" >
      <div class="baseTitle">基本信息</div>
           <Form :label-width="100">
             <Row :gutter="10" class="xzjz">
                 <Col span="8">
                    <FormItem :model="formItem" label="电站：">
                     <Select v-model="formItem.powerStation" clearable filterable @on-change="getHd">
                        <Option v-for="(item, index) in powerStationList" :value="item" :key="index">{{item}}</Option>
                    </Select>
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="HD编号：">
                      <Select v-model="formItem.hdNumber" clearable filterable :disabled="HBnumberList.length==0" @on-change="getJz">
                        <Option v-for="(item, index) in HBnumberList" :value="item" :key="index">{{item}}</Option>
                    </Select>
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="机组编号：">
                        <Select v-model="formItem.aircrewNumber" clearable filterable :disabled="JZnumberList.length==0" @on-change="getMode">
                          <Option v-for="(item, index) in JZnumberList" :value="item" :key="index">{{item}}</Option>
                      </Select>
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="型号：">
                      {{formItem.model}}
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="试验日期：">
                      <DatePicker
                      type="datetime"
                      @on-change="time3"

                      v-model="formItem.experimentTime"
                      format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择日期"
                      style="width: 100%"
                    ></DatePicker>
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="试验代码：">
                      <Input v-model="formItem.experimentCode" placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
             </Row>
           </Form>
           <div class="baseTitle">试验问题</div>
           <Form :label-width="80">
             <Row :gutter="10" class="xzjz">
                  <Col span="7">
                    <FormItem label="功能位置：">
                      <Input v-model="qxForm.location" placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
                  <Col span="7">
                    <FormItem label="异常情况：">
                      <Input v-model="qxForm.abnormalities" placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
                  <Col span="7">
                    <FormItem label="建议行动：">
                      <Input v-model="qxForm.suggestAction" placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
                  <Col span="3">
                    <Button type="default" @click="addQX"> 添加</Button>
                  </Col>
                   <Col span="24" style="margin-bottom:10px;">
                    <Table border :columns="columns2" :data="qxList"></Table>
                  </Col>
                  <div class="baseTitle">试验参数</div>
                  <table width="100%" class="maintb">
        <tr>
          <th>参数组</th>
          <th>参数名称</th>
          <th>单位</th>
          <th>参数代码</th>
          <th>参考值</th>
          <th>输入值</th>
        </tr>
        <tr>
          <td rowspan="8">功能参数</td>
          <td>启动时间</td>
          <td> s</td>
          <td></td>
          <td><10s</td>
          <td><Input v-model="formItem.functionParameter2" size="small" placeholder="请输入"></Input></td>
        </tr>
         <tr>
          <td>柴油机转速</td>
          <td>rpm</td>
          <td>300ID</td>
          <td>1500±15rpm</td>
          <td><Input v-model="formItem.functionParameter3" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>柴油机转速</td>
          <td>rpm</td>
          <td>300MC</td>
          <td>1500±15rpm</td>
          <td><Input v-model="formItem.functionParameter4" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机有功功率</td>
          <td></td>
          <td>431MW</td>
          <td>2280KW</td>
          <td><Input v-model="formItem.functionParameter5" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机无功功率</td>
          <td></td>
          <td>432MQ</td>
          <td>1710KVar</td>
          <td><Input v-model="formItem.functionParameter6" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机输出电流</td>
          <td></td>
          <td>433MI</td>
          <td>249A</td>
          <td><Input v-model="formItem.functionParameter7" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机电压</td>
          <td>KV</td>
          <td>434MU</td>
          <td>6.6+或-10%KV</td>
          <td><Input v-model="formItem.functionParameter8" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机功率</td>
          <td>HZ</td>
          <td>433MF</td>
          <td>50+/-0.5Hz</td>
          <td><Input v-model="formItem.functionParameter9" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td rowspan="12">润滑油回路</td>
          <td>润滑油过滤器前后压差</td>
          <td>bar</td>
          <td>151LP</td>
          <td>0≤P≤1.5bar</td>
          <td><Input v-model="formItem.lubricatingOilLoop1" size="small" placeholder="请输入"></Input></td>
        </tr>
         <tr>
          <td>过滤器前润滑油压</td>
          <td>bar</td>
          <td>150LP</td>
          <td>7.5bar≤P≤16bar</td>
          <td><Input v-model="formItem.lubricatingOilLoop2" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>润滑油温度</td>
          <td>℃</td>
          <td>150ID</td>
          <td>＜80℃</td>
          <td><Input v-model="formItem.lubricatingOilLoop3" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>润滑油入口压力</td>
          <td>bar</td>
          <td>150MP</td>
          <td>＞5bar</td>
          <td><Input v-model="formItem.lubricatingOilLoop4" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>转动部件润滑油压力</td>
          <td>bar</td>
          <td>152MP</td>
          <td>＞5bar</td>
          <td><Input v-model="formItem.lubricatingOilLoop5" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>传动装置润滑油压力</td>
          <td>bar</td>
          <td>155MP</td>
          <td>2.5bar≤P≤16bar</td>
          <td><Input v-model="formItem.lubricatingOilLoop6" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>润滑油过滤器堵塞压力值</td>
          <td>bar</td>
          <td>156MP</td>
          <td>＜0.83bar</td>
          <td><Input v-model="formItem.lubricatingOilLoop7" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>活塞冷却油压力</td>
          <td>bar</td>
          <td>157MP</td>
          <td>4.5bar≤P≤16bar</td>
          <td><Input v-model="formItem.lubricatingOilLoop8" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>润滑油入口温度</td>
          <td>℃</td>
          <td>150MT</td>
          <td>≤85℃</td>
          <td><Input v-model="formItem.lubricatingOilLoop9" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>润滑油箱液位</td>
          <td>mm</td>
          <td>150MN</td>
          <td>＞200mm</td>
          <td><Input v-model="formItem.lubricatingOilLoop10" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>曲轴箱液位</td>
          <td>mm</td>
          <td>151MN</td>
          <td>180mm＜L＜250mm</td>
          <td><Input v-model="formItem.lubricatingOilLoop11" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>曲轴箱油位</td>
          <td></td>
          <td>150LN</td>
          <td>MIN＜L＜MAX</td>
          <td><Input v-model="formItem.lubricatingOilLoop12" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td rowspan="10">主冷却水回路	</td>
          <td>A侧主冷却水入口压力</td>
          <td>bar</td>
          <td>200LP</td>
          <td>＞2.2bar</td>
          <td><Input v-model="formItem.mainCoolingwaterLoop1" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B侧主冷却水入口压力</td>
          <td>bar</td>
          <td>201LP</td>
          <td>＞2.2bar</td>
          <td><Input v-model="formItem.mainCoolingwaterLoop2" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>主冷却水入口温度</td>
          <td>℃</td>
          <td>200ID</td>
          <td>60~85℃</td>
          <td><Input v-model="formItem.mainCoolingwaterLoop3" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>主冷却水出口温度</td>
          <td>℃</td>
          <td>201ID</td>
          <td>70~90℃</td>
          <td><Input v-model="formItem.mainCoolingwaterLoop4" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>主冷却水入口温度</td>
          <td>℃</td>
          <td>200MT</td>
          <td>60℃≤T≤85℃</td>
          <td><Input v-model="formItem.mainCoolingwaterLoop5" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>主冷却水出口温度（高:90℃）</td>
          <td>℃</td>
          <td>201MT</td>
          <td>＜90℃</td>
          <td><Input v-model="formItem.mainCoolingwaterLoop6" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>主冷却水出口温度（高高:95℃）</td>
          <td>℃</td>
          <td>202MT</td>
          <td>＜95℃</td>
          <td><Input v-model="formItem.mainCoolingwaterLoop7" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>A侧主冷却水压力</td>
          <td>bar</td>
          <td>200MP</td>
          <td>＞1.5bar</td>
          <td><Input v-model="formItem.mainCoolingwaterLoop8" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B侧主冷却水压力</td>
          <td>bar</td>
          <td>201MP</td>
          <td>＞1.5bar</td>
          <td><Input v-model="formItem.mainCoolingwaterLoop9" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>膨胀水箱200BA液位</td>
          <td>mm</td>
          <td>200MN</td>
          <td>＞308mm</td>
          <td><Input v-model="formItem.mainCoolingwaterLoop10" size="small" placeholder="请输入"></Input></td>
        </tr>
         <tr>
          <td rowspan="8">增压空气冷却水回路</td>
          <td>增压空气冷却水入口温度</td>
          <td>℃</td>
          <td>205ID</td>
          <td>5~55℃</td>
          <td><Input v-model="formItem.chargeAirCoolingWaterLoop1" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>增压空气冷却水出口温度</td>
          <td>℃</td>
          <td>206ID</td>
          <td>20~70℃</td>
          <td><Input v-model="formItem.chargeAirCoolingWaterLoop2" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>增压空气冷却水入口压力</td>
          <td>bar</td>
          <td>202LP</td>
          <td>1.8bar≤P≤4bar</td>
          <td><Input v-model="formItem.chargeAirCoolingWaterLoop3" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>增压空气冷却水入口温度</td>
          <td>℃</td>
          <td>205MT</td>
          <td>≤55℃</td>
          <td><Input v-model="formItem.chargeAirCoolingWaterLoop4" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>增压空气冷却水出口温度（高:65℃）</td>
          <td>℃</td>
          <td>206MT</td>
          <td>＜65℃</td>
          <td><Input v-model="formItem.chargeAirCoolingWaterLoop5" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>增压空气冷却水出口温度（高高:70℃）</td>
          <td>℃</td>
          <td>207MT</td>
          <td>＜70℃</td>
          <td><Input v-model="formItem.chargeAirCoolingWaterLoop6" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>增压空气冷却水压力</td>
          <td>bar</td>
          <td>202MP</td>
          <td>＞1.2bar</td>
          <td><Input v-model="formItem.chargeAirCoolingWaterLoop7" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>201BA膨胀水箱液位</td>
          <td>mm</td>
          <td>201MN</td>
          <td>＞308mm</td>
          <td><Input v-model="formItem.chargeAirCoolingWaterLoop8" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td rowspan="24">进排气回路</td>
          <td>A侧增压空气入口压力</td>
          <td>bar</td>
          <td>300HV</td>
          <td>≤3.3bar</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit1" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B侧增压空气入口压力</td>
          <td>bar</td>
          <td>301HV</td>
          <td>≤3.3bar</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit2" size="small" placeholder="请输入"></Input></td>
        </tr>
         <tr>
          <td>A1缸排气温度</td>
          <td>℃</td>
          <td>325ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit3" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>A2缸排气温度</td>
          <td>℃</td>
          <td>326ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit4" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>A3缸排气温度</td>
          <td>℃</td>
          <td>327ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit5" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>A4缸排气温度</td>
          <td>℃</td>
          <td>328ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit6" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>A5缸排气温度</td>
          <td>℃</td>
          <td>329ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit7" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>A6缸排气温度</td>
          <td>℃</td>
          <td>330ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit8" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>A7缸排气温度</td>
          <td>℃</td>
          <td>331ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit9" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>A8缸排气温度</td>
          <td>℃</td>
          <td>332ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit10" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>A9缸排气温度</td>
          <td>℃</td>
          <td>333ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit11" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>A10缸排气温度</td>
          <td>℃</td>
          <td>334ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit12" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B1缸排气温度</td>
          <td>℃</td>
          <td>335ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit13" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B2缸排气温度</td>
          <td>℃</td>
          <td>336ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit14" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B3缸排气温度</td>
          <td>℃</td>
          <td>337ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit15" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B4缸排气温度</td>
          <td>℃</td>
          <td>338ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit16" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B5缸排气温度</td>
          <td>℃</td>
          <td>339ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit17" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B6缸排气温度</td>
          <td>℃</td>
          <td>340ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit18" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B7缸排气温度</td>
          <td>℃</td>
          <td>341ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit19" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B8缸排气温度</td>
          <td>℃</td>
          <td>342ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit20" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B9缸排气温度</td>
          <td>℃</td>
          <td>343ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit21" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>B10缸排气温度</td>
          <td>℃</td>
          <td>344ID</td>
          <td>＜750℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit22" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>涡轮增压器后排气温度</td>
          <td>℃</td>
          <td>324ID</td>
          <td>＜570℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit23" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>涡轮增压器后排气温度</td>
          <td>℃</td>
          <td>324MT</td>
          <td>＜570℃</td>
          <td><Input v-model="formItem.intakeAndExhaustCircuit24" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td rowspan="5">燃油回路</td>
          <td>燃油双联过滤器压差</td>
          <td>bar</td>
          <td>101HV</td>
          <td>0≤P≤1.3bar</td>
          <td><Input v-model="formItem.fuelCircuit1" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>燃油前置过滤器压差</td>
          <td>bar</td>
          <td>100HV</td>
          <td>0≤P≤600mbar</td>
          <td><Input v-model="formItem.fuelCircuit2" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>燃油储存罐001BA</td>
          <td>mm</td>
          <td>001MN</td>
          <td>＞500mm</td>
          <td><Input v-model="formItem.fuelCircuit3" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>燃油日用罐103BA</td>
          <td>mm</td>
          <td>104MN</td>
          <td>990＜L＜1485mm</td>
          <td><Input v-model="formItem.fuelCircuit4" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>燃油泄漏罐102BA</td>
          <td>mm</td>
          <td>100MN</td>
          <td>＜150mm</td>
          <td><Input v-model="formItem.fuelCircuit5" size="small" placeholder="请输入"></Input></td>
        </tr>
         <tr>
          <td rowspan="2">发电机轴承温度</td>
          <td>发电机驱动端轴承温度</td>
          <td>℃</td>
          <td>171MT</td>
          <td>≤85℃</td>
          <td><Input v-model="formItem.generatorBearingTemperature1" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机非驱动端轴承温度</td>
          <td>℃</td>
          <td>172MT</td>
          <td>≤85℃</td>
          <td><Input v-model="formItem.generatorBearingTemperature2" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td rowspan="3">线圈温度</td>
          <td>发电机绕组温度</td>
          <td>℃</td>
          <td>173MT</td>
          <td>≤140℃</td>
          <td><Input v-model="formItem.coilTemperature1" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机绕组温度</td>
          <td>℃</td>
          <td>174MT</td>
          <td>≤140℃</td>
          <td><Input v-model="formItem.coilTemperature2" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机绕组温度</td>
          <td>℃</td>
          <td>175MT</td>
          <td>≤140℃</td>
          <td><Input v-model="formItem.coilTemperature3" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td rowspan="5">发电机润滑油回路	</td>
          <td>发电机润滑油温度</td>
          <td></td>
          <td>176MT</td>
          <td></td>
          <td><Input v-model="formItem.generatorLubricantLoop1" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机润滑油压力</td>
          <td></td>
          <td>CP010</td>
          <td></td>
          <td><Input v-model="formItem.generatorLubricantLoop2" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机润滑油压力</td>
          <td></td>
          <td>CP020</td>
          <td></td>
          <td><Input v-model="formItem.generatorLubricantLoop3" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机润滑油流量</td>
          <td></td>
          <td>171MD</td>
          <td></td>
          <td><Input v-model="formItem.generatorLubricantLoop4" size="small" placeholder="请输入"></Input></td>
        </tr>
        <tr>
          <td>发电机润滑油流量</td>
          <td></td>
          <td>172MD</td>
          <td></td>
          <td><Input v-model="formItem.generatorLubricantLoop5" size="small" placeholder="请输入"></Input></td>
        </tr>
        </table>
                  <!-- <Col span="7">
                    <FormItem label="参数组：">
                      <Input v-model="csForm.groupName" placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
                  <Col span="7">
                    <FormItem label="参数名称：">
                      <Input v-model="csForm.name" placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
                  <Col span="7">
                    <FormItem label="参数代码：">
                      <Input v-model="csForm.code" placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
                  <Col span="7">
                    <FormItem label="单位：">
                      <Input v-model="csForm.unit" placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
                  <Col span="7">
                    <FormItem label="参考值：">
                      <Input v-model="csForm.referenceValue" placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
                  <Col span="7">
                    <FormItem label="试验值：">
                      <Input v-model="csForm.experimentValue" placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
                  <Col span="3">
                    <Button type="default" @click="addCS"> 添加</Button>
                  </Col> -->
                </Row>
                <Row :gutter="10" class="xzjz">
                  <!-- <Col span="24" style="margin-bottom:10px;">
                    <Table border :columns="columns3" :data="csList"></Table>
                  </Col> -->
                  <div class="baseTitle">填报信息</div>
                  <Col span="8">
                    <FormItem label="记录人：">
                      <!-- <Select @on-change="jiluName" v-model="formItem.recordId" label-in-value clearable filterable>
                          <Option v-for="(item, index) in peopleList" :value="item.id" :key="index">{{item.trueName}}</Option>
                      </Select> -->
                      <Input v-model="recordName" disabled placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="记录时间：">
                      <!-- <DatePicker
                        type="datetime"
                        v-model="formItem.recordTime"
                        format="yyyy-MM-dd HH:mm:ss"
                         @on-change="time4"
                        placeholder="记录时间"
                        style="width: 100%"
                      ></DatePicker> -->
                       <Input v-model="recordTime" disabled placeholder="请输入"></Input>
                    </FormItem>
                  </Col>
             </Row>
           </Form>
   <div slot="footer">
               <Button @click="modal1=false">取消</Button>
              <Button type="primary" :loading="btnClick" @click="ok">确定</Button>
          </div>

    </Modal>
    <Modal :mask-closable="false" v-model="delmodal1" width="360" class-name="vertical-center-modal" @on-ok="remove(delId1)">
        <p slot="header" style="color:#f60;text-align:center">
            <Icon type="ios-information-circle"></Icon>
            <span>确认删除</span>
        </p>

        <div style="text-align:center">
            <p>确认删除此数据么？</p>
        </div>
    </Modal>
    <Modal :mask-closable="false" v-model="delmodal2" width="360" class-name="vertical-center-modal" @on-ok="remove2(delIndex2,delId2)">
        <p slot="header" style="color:#f60;text-align:center">
            <Icon type="ios-information-circle"></Icon>
            <span>确认删除</span>
        </p>

        <div style="text-align:center">
            <p>确认删除此数据么？</p>
        </div>
    </Modal>
    <Modal :mask-closable="false" v-model="delmodal3" width="360" class-name="vertical-center-modal" @on-ok="remove3(delIndex3,delId3)">
        <p slot="header" style="color:#f60;text-align:center">
            <Icon type="ios-information-circle"></Icon>
            <span>确认删除</span>
        </p>

        <div style="text-align:center">
            <p>确认删除此数据么？</p>
        </div>
    </Modal>
    <!-- 新增弹窗结束 -->
  </div>
</template>

<script>
import {
  getSelectOption,
  getAllPeople, getTime, getAllEqu
} from '@/api/select'
import {
  getTableData,
  add,
  update,
  del,
  delQX,
  delCS,
  findQX,
  findCS,
  getEchart, downExcel, getEchartR, monthlyTestRecordMtu
} from '@/api/testRecord'
import { getToken } from '@/libs/util'
export default {
  data () {
    return {
      fileheader: {
        Authorization: 'Bearer ' + (getToken() ? getToken() : '')
      },
      canshu:[
        // {type:'functionParameter1',name:'试验代码'},
        {type:'functionParameter2',name:'启动时间'},
        {type:'functionParameter3',name:'柴油机转速'},
        {type:'functionParameter4',name:'柴油机转速'},
        {type:'functionParameter5',name:'发电机有功功率'},
        {type:'functionParameter6',name:'发电机无功功率'},
        {type:'functionParameter7',name:'发电机输出电流'},
        {type:'functionParameter8',name:'发电机电压'},
        {type:'functionParameter9',name:'发电机功率'},

        {type:'lubricatingOilLoop1',name:'润滑油过滤器前后压差'},
        {type:'lubricatingOilLoop2',name:'过滤器前润滑油压'},
        {type:'lubricatingOilLoop3',name:'润滑油温度'},
        {type:'lubricatingOilLoop4',name:'润滑油入口压力'},
        {type:'lubricatingOilLoop5',name:'转动部件润滑油压力'},
        {type:'lubricatingOilLoop6',name:'传动装置润滑油压力'},
        {type:'lubricatingOilLoop7',name:'润滑油过滤器堵塞压力值'},
        {type:'lubricatingOilLoop8',name:'活塞冷却油压力'},
        {type:'lubricatingOilLoop9',name:'润滑油入口温度'},

        {type:'lubricatingOilLoop10',name:'润滑油箱液位'},
        {type:'lubricatingOilLoop11',name:'曲轴箱液位'},
        {type:'lubricatingOilLoop12',name:'曲轴箱油位'},
        {type:'mainCoolingwaterLoop1',name:'A侧主冷却水入口压力'},
        {type:'mainCoolingwaterLoop2',name:'B侧主冷却水入口压力'},
        {type:'mainCoolingwaterLoop3',name:'主冷却水入口温度'},
        {type:'mainCoolingwaterLoop4',name:'主冷却水出口温度'},
        {type:'mainCoolingwaterLoop5',name:'主冷却水入口温度'},
        {type:'mainCoolingwaterLoop6',name:'主冷却水出口温度（高:90℃)'},

        {type:'mainCoolingwaterLoop7',name:'主冷却水回路-主冷却水出口温度（高高:95℃）'},
        {type:'mainCoolingwaterLoop8',name:'A侧主冷却水压力'},
        {type:'mainCoolingwaterLoop9',name:'B侧主冷却水压力'},
        {type:'mainCoolingwaterLoop10',name:'膨胀水箱200BA液位'},
        {type:'chargeAirCoolingWaterLoop1',name:'增压空气冷却水入口温度'},
        {type:'chargeAirCoolingWaterLoop2',name:'增压空气冷却水出口温度'},
        {type:'chargeAirCoolingWaterLoop3',name:'增压空气冷却水入口压力'},
        {type:'chargeAirCoolingWaterLoop4',name:'增压空气冷却水入口温度'},
        {type:'chargeAirCoolingWaterLoop5',name:'增压空气冷却水出口温度（高:65℃）'},

        {type:'chargeAirCoolingWaterLoop6',name:'增压空气冷却水出口温度（高高:70℃）'},
        {type:'chargeAirCoolingWaterLoop7',name:'增压空气冷却水压力'},
        {type:'chargeAirCoolingWaterLoop8',name:'201BA膨胀水箱液位'},
        {type:'intakeAndExhaustCircuit1',name:'A侧增压空气入口压力'},
        {type:'intakeAndExhaustCircuit2',name:'B侧增压空气入口压力'},
        {type:'intakeAndExhaustCircuit3',name:'A1缸排气温度'},
        {type:'intakeAndExhaustCircuit4',name:'A2缸排气温度'},
        {type:'intakeAndExhaustCircuit5',name:'A3缸排气温度'},
        {type:'intakeAndExhaustCircuit6',name:'A4缸排气温度'},

        {type:'intakeAndExhaustCircuit7',name:'A5缸排气温度'},
        {type:'intakeAndExhaustCircuit8',name:'A6缸排气温度'},
        {type:'intakeAndExhaustCircuit9',name:'A7缸排气温度'},
        {type:'intakeAndExhaustCircuit10',name:'A8缸排气温度'},
        {type:'intakeAndExhaustCircuit11',name:'A9缸排气温度'},
        {type:'intakeAndExhaustCircuit12',name:'A10缸排气温度'},
        {type:'intakeAndExhaustCircuit13',name:'B1缸排气温度'},
        {type:'intakeAndExhaustCircuit14',name:'B2缸排气温度'},
        {type:'intakeAndExhaustCircuit15',name:'B3缸排气温度'},



        {type:'intakeAndExhaustCircuit16',name:'B4缸排气温度'},
        {type:'intakeAndExhaustCircuit17',name:'B5缸排气温度'},
        {type:'intakeAndExhaustCircuit18',name:'B6缸排气温度'},
        {type:'intakeAndExhaustCircuit19',name:'B7缸排气温度'},
        {type:'intakeAndExhaustCircuit20',name:'B8缸排气温度'},
        {type:'intakeAndExhaustCircuit21',name:'B9缸排气温度'},
        {type:'intakeAndExhaustCircuit22',name:'B10缸排气温度'},
        {type:'intakeAndExhaustCircuit23',name:'涡轮增压器后排气温度'},
        {type:'intakeAndExhaustCircuit24',name:'涡轮增压器后排气温度'},

        {type:'fuelCircuit1',name:'燃油双联过滤器压差'},
        {type:'fuelCircuit2',name:'燃油前置过滤器压差'},
        {type:'fuelCircuit3',name:'燃油储存罐001BA'},
        {type:'fuelCircuit4',name:'燃油日用罐103BA'},
        {type:'fuelCircuit5',name:'燃油泄漏罐102BA'},
        {type:'generatorBearingTemperature1',name:'发电机驱动端轴承温度'},
        {type:'generatorBearingTemperature2',name:'发电机非驱动端轴承温度'},
        {type:'coilTemperature1',name:'发电机绕组温度'},
        {type:'coilTemperature2',name:'发电机绕组温度'},

        {type:'coilTemperature3',name:'发电机绕组温度'},
        {type:'generatorLubricantLoop1',name:'发电机润滑油温度'},
        {type:'generatorLubricantLoop2',name:'发电机润滑油压力'},
        {type:'generatorLubricantLoop3',name:'发电机润滑油压力'},
        {type:'generatorLubricantLoop4',name:'发电机润滑油流量'},
        {type:'generatorLubricantLoop5',name:'发电机润滑油流量'}
        ],
      timearry: [],
      options2: {
        shortcuts: [
          {
            text: '最近一周',
            value () {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
              return [start, end]
            }
          },
          {
            text: '最近一月',
            value () {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
              return [start, end]
            }
          },
          {
            text: '最近三月',
            value () {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
              return [start, end]
            }
          }
        ]
      },
      btnClick: false,
      loading: true,
      recordName: localStorage.getItem('recordUserName'),
      recordId: localStorage.getItem('recordUserId'),
      recordTime: getTime(),
      delmodal1: false,
      delId1: 0,
      delmodal2: false,
      delIndex2: 0,
      delId2: 0,
      delmodal3: false,
      delIndex3: 0,
      delId3: 0,
      allEquList: [],
      allEquList2: [],
      peopleList: [],
      powerStationList: [],
      HBnumberList: [],
      JZnumberList: [],
      modal1: false,
      title1: '新增记录',
      total: 0,
      pageNo: 1,
      pageSize: 10,
      qxForm: {},
      qxList: [],
      csForm: {},
      csList: [],
      tagList1: [],
      colorarry: [
        '#c12e34',
        '#e6b600',
        '#0098d9',
        '#2b821d',
        '#005eaa',
        '#339ca8',
        '#a134d4',
        '#32a487',
        '#eb1e99',
        '#ff8819'
      ],
      searchItem: {
        powerStation: '',
        aircrewNumber: '',
        hdNumber: '',
        startExperimentTime: '',
        endExperimentTime: '',
        type: 'functionParameter2'
      },
      formItem: {

      },
      columns: [
        {
          type: 'index',
          width: 60,
          title: '序号',
          align: 'center'
        },
        {
          title: '电站',
          key: 'powerStation'
        },
        {
          title: 'HD编号',
          key: 'hdNumber'
        },
        {
          title: '机组编号',
          key: 'aircrewNumber'
        },
        {
          title: '试验日期',
          key: 'experimentTime'
        },
        {
          title: '试验代码(PT)',
          key: 'experimentCode'
        },
        {
          title: '记录人',
          key: 'recordName'
        },
        {
          title: '记录时间',
          key: 'recordTime',
          width: 150
        },
        {
          title: '操作',
          key: 'action',
          width: 150,
          align: 'center',
          render: (h, params) => {
            return h('div', [
              h(
                'Button',
                {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  style: {
                    marginRight: '5px'
                  },
                  on: {
                    click: () => {
                      this.edit(JSON.stringify(params))
                    }
                  }
                },
                '编辑'
              ),
              h(
                'Button',
                {
                  props: {
                    type: 'error',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      this.openDel1(params.row.id)
                    }
                  }
                },
                '删除'
              )
            ])
          }
        }
      ],
      tableData: [],
      columns2: [
        {
          title: '功能位置',
          key: 'location'
        },
        {
          title: '异常情况',
          key: 'abnormalities'
        },
        {
          title: '建议行动',
          key: 'suggestAction'
        },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          render: (h, params) => {
            return h('div', [
              h(
                'Button',
                {
                  props: {
                    type: 'error',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      this.openDel2(params.index, params.row.id)
                    }
                  }
                },
                '删除'
              )
            ])
          }
        }
      ],
      tableData2: [],
      columns3: [
        {
          title: '参数组',
          key: 'groupName'
        },
        {
          title: '参数名称',
          key: 'name'
        },
        {
          title: '参数代码',
          key: 'code'
        },
        {
          title: '单位',
          key: 'unit'
        },
        {
          title: '参考值',
          key: 'referenceValue'
        },
        {
          title: '试验值',
          key: 'experimentValue'
        },
        {
          title: '操作',
          key: 'action',
          width: 200,
          align: 'center',
          render: (h, params) => {
            return h('div', [
              h(
                'Button',
                {
                  props: {
                    type: 'error',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      this.openDel3(params.index, params.row.id)
                    }
                  }
                },
                '删除'
              )
            ])
          }
        }
      ],
      tableData3: [],
      option: {
        tooltip: {},
        legend: {
          data: [],
          top: '10',
          type: 'scroll'
        },
        dataZoom: [],
        xAxis: {
          type: 'time',
          axisLabel: {
            interval: 0,
            formatter: function (time) {
              const dateTime = new Date(time)
              const year = dateTime.getFullYear()
              const month =
                dateTime.getMonth() + 1 < 10
                  ? '0' + (dateTime.getMonth() + 1)
                  : dateTime.getMonth() + 1
              const date =
                dateTime.getDate() < 10
                  ? '0' + dateTime.getDate()
                  : dateTime.getDate()
              return (
                year +
                '-' +
                month +
                '-' +
                date
              )
            }
          }
        },
        yAxis: {
          type: 'value'
        },
        series: []
      }
    }
  },
  methods: {
    fileSuccess (response, file, fileList) {
      // let dataArry=[];
      // for(let i=0;i<fileList.length;i++){
      //   if(fileList[i].response.data){
      //     this.uploadList.push(fileList[i].response.data)
      //   }
      // }
      // this.uploadList=this.uploadList.concat(response.data);
      // this.formItem.url = this.uploadList.join(',')
      this.$Message.info('报告上传成功！')
    },
    tabclick (e) {
      if (e == 'tb1') {
        this.$router.push({ path: 'testRecord' })
      } else if (e == 'tb2') {
        this.$router.push({ path: 'testRecord2' })
      } else if (e == 'tb3') {
        this.$router.push({ path: 'testRecord3' })
      } else if (e == 'tb4') {
        this.$router.push({ path: 'testRecord4' })
      } else if (e == 'tb5') {
        this.$router.push({ path: 'testRecord5' })
      } else {
        this.$router.push({ path: 'testRecord6' })
      }
    },
    down () {
      downExcel(this.searchItem).then(res => {
        const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;' })

        const ie = navigator.userAgent.match(/MSIE\s([\d.]+)/),
          ie11 = navigator.userAgent.match(/Trident\/7.0/) && navigator.userAgent.match(/rv:11/),
          ieEDGE = navigator.userAgent.match(/Edge/g),
          ieVer = (ie ? ie[1] : (ie11 ? 11 : (ieEDGE ? 12 : -1)))
        if (ie && ieVer < 10) {
          this.message.error('No blobs on IE<10')
          return
        }
        if (ieVer > -1) {
          window.navigator.msSaveBlob(blob, '试验记录.xlsx')
        } else {
          const url = window.URL.createObjectURL(blob)
          let link = document.createElement('a')
          link.setAttribute('href', url)
          link.setAttribute('download', '试验记录.xlsx')
          document.body.appendChild(link)
          link.click()
          document.body.removeChild(link)
        }
      })
    },
    // 获取所有人员
    getAllPeople () {
      getAllPeople(
        null
      ).then(res => {
        this.peopleList = res.data
      }).catch(err => {
        console.error('err>' + JSON.stringify(err))
      })
    },

    jiluName (e) {
      this.formItem.recordName = e.label
    },
    changeTime (e) {
      this.searchItem.startExperimentTime = e[0]
      this.searchItem.endExperimentTime = e[1]
      this.$echarts.init(document.getElementById('myChart')).dispose()

      this.tagList1 = []
      this.option.legend.data = []
      this.option.series = []
      this.addJz()
    },
    handleClose1 (event, name) {
      this.$echarts.init(document.getElementById('myChart')).dispose()
      const index = this.tagList1.indexOf(name)
      this.tagList1.splice(index, 1)
      this.option.legend.data.splice(index, 1)
      this.option.series.splice(index, 1)
      this.$echarts.init(document.getElementById('myChart')).setOption(this.option)
    },
    addJz () {
      let that = this
      if (this.tagList1.length > 9) {
        this.$Message.info('选择的对比已经很多了')
        return false
      }

      if (this.searchItem.powerStation == undefined) {
        this.$Message.info('请选择电站')
        return false
      }
      if (this.searchItem.hdNumber == undefined) {
        this.$Message.info('请选择HD编号')
        return false
      }
      if (this.searchItem.aircrewNumber == undefined) {
        this.$Message.info('请选择机组编号')
        return false
      }
      // if (this.searchItem.groupName == '') {
      //   this.$Message.info('请输入参数组')
      //   return false
      // }
      // if (this.searchItem.name == '') {
      //   this.$Message.info('请输入参数名称')
      //   return false
      // }
      getEchart(this.searchItem).then(res => {
        if (res.code == 0 && res.data.length > 0) {
          let csname=that.canshu.filter(item=>item.type==that.searchItem.type)[0].name;
          if (that.tagList1.indexOf(that.searchItem.aircrewNumber + '-' + csname) == -1) {
            that.tagList1.push(that.searchItem.aircrewNumber + '-' + csname)
            that.$echarts.init(document.getElementById('myChart')).dispose()
            that.option.legend.data.push(that.searchItem.aircrewNumber + '-' + csname)
            let sjcolor = that.color16()
            let arry = []
            for (let n = 0; n < res.data.length; n++) {
              arry.push([res.data[n].date, res.data[n].value])
            }
            that.option.series.push({
              name: that.searchItem.aircrewNumber + '-' + csname,
              data: arry,
              type: 'line',
              smooth: true,
              symbolSize: 8, // 折线点的大小
              itemStyle: {
                normal: {
                  color: sjcolor, // 折线点的颜色
                  lineStyle: {
                    color: sjcolor // 折线的颜色
                  }
                }
              }
            })
            that.$echarts.init(document.getElementById('myChart')).setOption(that.option)
          }
        } else {
          that.$Message.info('此选项下无数据！')
        }
      })
    },

    color16 () {
      var n = Math.floor(Math.random() * this.colorarry.length + 1) - 1
      return this.colorarry[n]
    },
    time1 (e) {
      this.searchItem.experimentDate = e
    },
    time2 (e) {
      this.searchItem.recordTime = e
    },
    time3 (e) {
      this.formItem.experimentDate = e
      console.log(this.formItem.experimentDate, '试验时间')
    },
    time4 (e) {
      this.formItem.recordTime = e
    },
    addQX () {
      if (this.qxForm.location == '' || this.qxForm.location == undefined) {
        this.$Message.info('请填写功能位置！')
        return false
      }
      if (this.qxForm.abnormalities == '' || this.qxForm.abnormalities == undefined) {
        this.$Message.info('请填写异常情况！')
        return false
      }
      if (this.qxForm.suggestAction == '' || this.qxForm.suggestAction == undefined) {
        this.$Message.info('请填写建议行动！')
        return false
      }
      this.qxList.push(this.qxForm)
      this.qxForm = {}
    },
    // addCS () {
    //   if (this.csForm.groupName == '' || this.csForm.groupName == undefined) {
    //     this.$Message.info('请填写参数组！')
    //     return false
    //   }
    //   if (this.csForm.name == '' || this.csForm.name == undefined) {
    //     this.$Message.info('请填写参数名称！')
    //     return false
    //   }
    //   if (this.csForm.code == '' || this.csForm.code == undefined) {
    //     this.$Message.info('请填写参数代码！')
    //     return false
    //   }
    //   if (this.csForm.unit == '' || this.csForm.unit == undefined) {
    //     this.$Message.info('请填写单位！')
    //     return false
    //   }
    //   if (this.csForm.referenceValue == '' || this.csForm.referenceValue == undefined) {
    //     this.$Message.info('请填写参考值！')
    //     return false
    //   }
    //   if (this.csForm.experimentValue == '' || this.csForm.experimentValue == undefined) {
    //     this.$Message.info('请填写试验值！')
    //     return false
    //   }
    //   this.csList.push(this.csForm)
    //   this.csForm = {}
    // },
    openDel1 (id) {
      this.delmodal1 = true
      this.delId1 = id
      // this.remove(params.index);
    },
    openDel2 (index, id) {
      this.delmodal2 = true
      this.delIndex2 = index
      this.delId2 = id
    },
    openDel3 (index, id) {
      this.delmodal3 = true
      this.delIndex3 = index
      this.delId3 = id
      console.log(this.delId3)
    },
    remove (id) {
      del({ id: id }).then(res => {
        if (res.code == 0) {
          this.$Message.info('删除成功')
          this.searchItem.pageNo = 1
          this.getDataList()
        } else {
          this.$Message.info(res.message)
        }
      }).catch(err => {
        console.error('err>' + JSON.stringify(err))
      })
    },
    remove2 (index, id) {
      this.qxList.splice(index, 1)
      // if(id){
      //   delQX({ id: id }).then(res => {
      //     if (res.code == 0) {
      //       this.$Message.info('删除成功');
      //       this.qxList.splice(index, 1);
      //     } else {
      //       this.$Message.info(res.message)
      //     }
      //   }).catch(err => {
      //     console.error('err>' + JSON.stringify(err))
      //   })
      // }else{
      //   this.qxList.splice(index, 1);
      //   this.$Message.info('删除成功');
      // }
    },
    remove3 (index, id) {
      this.csList.splice(index, 1)
      console.log(id, '删除id')
      // if(id){
      //   delCS({ id: id }).then(res => {
      //     if (res.code == 0) {
      //       this.$Message.info('删除成功');
      //       this.csList.splice(index, 1);
      //     } else {
      //       this.$Message.info(res.message)
      //     }
      //   }).catch(err => {
      //     console.error('err>' + JSON.stringify(err))
      //   })
      // }else{
      //   this.csList.splice(index, 1);
      //   this.$Message.info('删除成功');
      // }
    },
    add () {
      this.title1 = '新增记录'
      this.modal1 = true
    },
    edit (params) {
      this.title1 = '编辑记录'
      this.formItem = JSON.parse(params).row
      this.modal1 = true
      findQX({ experimentRecord: JSON.parse(params).row.id }).then(res => {
        if (res.code == 0) {
          this.qxList = res.data
        }
      }).catch(err => {
        console.error('err>' + JSON.stringify(err))
      })
      findCS({ experimentRecord: JSON.parse(params).row.id }).then(res => {
        if (res.code == 0) {
          this.csList = res.data
        }
      }).catch(err => {
        console.error('err>' + JSON.stringify(err))
      })

      this.allEquList2 = this.allEquList.filter(item => item.powerStation == this.formItem.powerStation)
      let arr2 = this.allEquList2.map(function (item) {
        return item.hdNumber
      })
      this.HBnumberList = [...new Set(arr2)]

      let arr3 = this.allEquList2.filter(item => item.hdNumber == this.formItem.hdNumber)
      let arr4 = arr3.map(function (item) {
        return item.aircrewNumber
      })
      this.JZnumberList = [...new Set(arr4)]
    },
    ok () {
      this.btnClick = true
      this.formItem.recordName = this.recordName
      this.formItem.recordId = this.recordId
      this.formItem.recordTime = this.recordTime
      let params = this.formItem
      for (var i = 0; i < this.qxList.length; i++) {
        params['defectAddDtoList[' + i + '].abnormalities'] = this.qxList[i].abnormalities
        params['defectAddDtoList[' + i + '].location'] = this.qxList[i].location
        params['defectAddDtoList[' + i + '].experimentRecordId'] = this.qxList[i].experimentRecordId
        params['defectAddDtoList[' + i + '].suggestAction'] = this.qxList[i].suggestAction
        params['defectAddDtoList[' + i + '].id'] = this.qxList[i].id
      }
      for (var i = 0; i < this.csList.length; i++) {
        params['paramAddDtoList[' + i + '].code'] = this.csList[i].code
        params['paramAddDtoList[' + i + '].experimentRecordId'] = this.csList[i].experimentRecordId
        params['paramAddDtoList[' + i + '].experimentValue'] = this.csList[i].experimentValue
        params['paramAddDtoList[' + i + '].groupName'] = this.csList[i].groupName
        params['paramAddDtoList[' + i + '].id'] = this.csList[i].id
        params['paramAddDtoList[' + i + '].name'] = this.csList[i].name
        params['paramAddDtoList[' + i + '].referenceValue'] = this.csList[i].referenceValue
        params['paramAddDtoList[' + i + '].unit'] = this.csList[i].unit
      }
      if (params.id) {
        delete params._index
        delete params._rowKey
        params.experimentTime = this.timeFormat(params.experimentTime)
        update(params).then(res => {
          if (res.code == 0) {
            this.$Message.info('编辑成功')
            this.getDataList()
            this.modal1 = false
            this.btnClick = false
          } else {
            this.$Message.info(res.message)
            this.btnClick = false
          }
        }).catch(err => {
          console.error('err>' + JSON.stringify(err))
        })
      } else {
        monthlyTestRecordMtu(params).then(res => {
          if (res.code == 0) {
            this.$Message.info('新增成功')
            this.getDataList()
            this.modal1 = false
            this.btnClick = false
          } else {
            this.$Message.info(res.message)
            this.btnClick = false
          }
        }).catch(err => {
          console.error('err>' + JSON.stringify(err))
        })
      }
    },
    timeFormat (time) {
      if (time instanceof Date == false) {
        return time
      }
      const dateTime = new Date(time)
      const year = dateTime.getFullYear()
      const month = this.addZero(dateTime.getMonth() + 1)
      const date = this.addZero(dateTime.getDate())
      const hour = this.addZero(dateTime.getHours())
      const minute = this.addZero(dateTime.getMinutes())
      const second = this.addZero(dateTime.getSeconds())
      return year + '-' + month + '-' + date + ' ' + hour + ':' + minute + ':' + second
    },
    addZero (v) {
      return v < 10 ? '0' + v : v
    },
    /** 分页 */
    changePage (pageNo) {
      this.pageNo = pageNo
      this.getDataList()
    },
    getDataList () {
      let that = this
      getTableData({ pageNo: this.pageNo, pageSize: this.pageSize }).then(res => {
        if (res.code == 0) {
          this.total = res.data.total
          this.tableData = res.data.list
          this.loading = false
          that.allEquList2 = that.allEquList.filter(
            item => item.powerStation == res.data.list[0].powerStation
          )
          let arr2 = that.allEquList2.map(function (item) {
            return item.hdNumber
          })
          that.HBnumberList = [...new Set(arr2)]

          let arr3 = that.allEquList2.filter(
            item => item.hdNumber == res.data.list[0].hdNumber
          )
          let arr4 = arr3.map(function (item) {
            return item.aircrewNumber
          })
          that.JZnumberList = [...new Set(arr4)]

          that.searchItem.powerStation = res.data.list[0].powerStation
          that.searchItem.hdNumber = res.data.list[0].hdNumber
          that.searchItem.aircrewNumber = res.data.list[0].aircrewNumber
          findCS({ experimentRecord: res.data.list[0].id }).then(res => {
            if (res.code == 0) {
              that.searchItem.type = res.data[0].groupName
            }
          })
        }
      }).catch(err => {
        console.error('err>' + JSON.stringify(err))
      })
    },
    getAllEqument () {
      let that = this
      getAllEqu(null).then(res => {
        this.allEquList = res.data
        let arr = res.data.map(function (item) {
          return item.powerStation
        })
        this.powerStationList = [...new Set(arr)]
        this.getDataList()
        setTimeout(() => {
          that.addJz()
        }, 500)
      })
    },
    getHd (e) {
      this.JZnumberList = []
      this.allEquList2 = this.allEquList.filter(item => item.powerStation == e)
      let arr2 = this.allEquList2.map(function (item) {
        return item.hdNumber
      })
      this.HBnumberList = [...new Set(arr2)]
    },
    getJz (e) {
      let arr = this.allEquList2.filter(item => item.hdNumber == e)
      let arr2 = arr.map(function (item) {
        return item.aircrewNumber
      })
      this.JZnumberList = [...new Set(arr2)]
    },
    getMode (e) {
      let arr = this.allEquList2.filter(item => item.hdNumber == this.formItem.hdNumber && item.aircrewNumber == e)
      this.formItem.model = arr[0].model
    }
  },
  mounted () {
    let mmtime = this.options2.shortcuts[2].value()
    this.searchItem.startExperimentTime = this.timeFormat(mmtime[0])
    this.searchItem.endExperimentTime = this.timeFormat(mmtime[1])
    this.timearry = this.options2.shortcuts[2].value()
    this.getAllEqument()
    this.getAllPeople()
    // 基于准备好的dom，初始化echarts实例
    let myChart = this.$echarts.init(document.getElementById('myChart'))
    // 绘制图表
    myChart.setOption(this.option)
  }
}
</script>

<style lang="less">
.testRecord {
  background: #fff;
  height: 100%;
  padding: 15px;
  font-size: 14px;
  .ivu-tabs.ivu-tabs-card > .ivu-tabs-bar .ivu-tabs-tab{
        border-radius: 0;
        background: #fff;
        margin-right:10px;
    }
  .ivu-tabs.ivu-tabs-card > .ivu-tabs-bar .ivu-tabs-tab-active{
        border-top: 2px solid #3399ff;
    }
   .ivu-tabs.ivu-tabs-card > .ivu-tabs-bar .ivu-tabs-tab-active:before{
        content: '';
        display: block;
        width: 100%;
        height: 1px;
        background: #3399ff;
        position: absolute;
        top: 0;
        left: 0;
    }
  .searchDiv {
    .marRight {
      margin-right: 15px;
    }
  }
  .ivu-form-item {
    margin-bottom: 15px;
  }
}
.baseTitle {
    font-weight: bold;
    font-size:16px;
    margin-bottom:10px;
  }
 .xzjz  {
   .ivu-form-item {
    margin-bottom: 10px;
  }
 }
 .chart{
   width: 100%;
 }
 .maintb {
    border-collapse: collapse;
  }
  .maintb td,.maintb th {
    border:1px solid #eaeaea;
    padding:5px 10px;
    text-align: center;
  }
  .maintb th {
    background:#f5f5f5;
  }
</style>
